import GiDot from '@/components/GiDot/index.vue'
import { h } from 'vue'
export const columnyjfqun = [
  {
    title: '文案内容',
    tooltip: true,
    ellipsis: true,
    width: 300,
    slotName: 'content'
  },
  {
    title: '发送群',
    width: 100,
    render: (data) => {
      return data.record.groupName || '--'
    }
  },
  {
    title: '发群状态',
    width: 100,
    render: (data) => {
      const status = data.record.status
      const type = status == 1 ? 'success' : status == -1 ? 'danger' : 'info'
      const text = status == 1 ? '发送成功' : status == -1 ? '发送失败' : '发送中'
      return h(GiDot, {
        animation: false,
        type: type,
        text: text
      })
    }
  },
  {
    title: '出单量',
    width: 100,
    dataIndex: 'orderNum',
    sortable: {
      sortDirections: ['ascend', 'descend']
    },
    render: (data) => {
      const text = data.record.orderNum
      return text == 0 ? 0 : text || '--'
    }
  },
  {
    title: 'GMV',
    width: 100,
    dataIndex: 'gmv',
    sortable: {
      sortDirections: ['ascend', 'descend']
    },
    render: (data) => {
      const text = data.record.gmv
      return text == 0 ? 0 : text || '--'
    }
  },
  {
    title: '佣金',
    width: 100,
    dataIndex: 'commission',
    sortable: {
      sortDirections: ['ascend', 'descend']
    },
    render: (data) => {
      const text = data.record.commission
      return text == 0 ? 0 : text || '--'
    }
  },
  {
    title: '发群时间',
    width: 180,
    dataIndex: 'sendTime',
    sortable: {
      sortDirections: ['ascend', 'descend']
    },
    render: (data) => {
      return data.record.sendTime || '--'
    }
  }
]

export const columnyjfquan = [
  {
    title: '文案内容',
    tooltip: true,
    ellipsis: true,
    width: 300,
    slotName: 'content'
  },
  {
    title: '发送群',
    width: 100,
    render: (data) => {
      return data.record.momentName || '--'
    }
  },
  {
    title: '发群状态',
    width: 100,
    render: (data) => {
      const status = data.record.status
      const type = status == 1 ? 'success' : status == -1 ? 'danger' : 'info'
      const text = status == 1 ? '发送成功' : status == -1 ? '发送失败' : '发送中'
      return h(GiDot, {
        animation: false,
        type: type,
        text: text
      })
    }
  },
  {
    title: '出单量',
    width: 100,
    render: (data) => {
      const text = data.record.orderNum
      return text == 0 ? 0 : text || '--'
    }
  },
  {
    title: 'GMV',
    width: 100,
    render: (data) => {
      const text = data.record.gmv
      return text == 0 ? 0 : text || '--'
    }
  },
  {
    title: '佣金',
    width: 100,
    render: (data) => {
      const text = data.record.commission
      return text == 0 ? 0 : text || '--'
    }
  },
  {
    title: '创建时间',
    width: 180,
    render: (data) => {
      return data.record.createdAt || '--'
    }
  },
  {
    title: '发圈时间',
    width: 180,
    render: (data) => {
      return data.record.sendAt || '--'
    }
  }
]

export const columnznfq = [
  {
    title: '发圈内容',
    tooltip: true,
    ellipsis: true,
    width: 300,
    slotName: 'content'
  },
  {
    title: '跟发来源',
    width: 100,
    render: (data) => {
      return data.record.momentName || '--'
    }
  },
  {
    title: '发圈状态',
    width: 100,
    render: (data) => {
      const status = data.record.status
      const type = status == 1 ? 'success' : status == -1 ? 'danger' : 'info'
      const text = status == 1 ? '发送成功' : status == -1 ? '发送失败' : '待发送'
      return h(GiDot, {
        animation: false,
        type: type,
        text: text
      })
    }
  },
  {
    title: '创建时间',
    width: 180,
    render: (data) => {
      return data.record.createdAt || '--'
    }
  },
  {
    title: '发圈时间',
    width: 180,
    render: (data) => {
      return data.record.sendAt || '--'
    }
  }
]

export const columnzxfq = [
  {
    title: '内容',
    tooltip: true,
    ellipsis: true,
    width: 300,
    slotName: 'content'
  },
  {
    title: '来源',
    width: 100,
    render: (data) => {
      return data.record.momentName || '--'
    }
  },
  {
    title: '状态',
    width: 100,
    render: (data) => {
      const status = data.record.status
      const type = status == 1 ? 'success' : status == -1 ? 'danger' : 'info'
      const text = status == 1 ? '发送成功' : status == -1 ? '发送失败' : '待发送'
      return h(GiDot, {
        animation: false,
        type: type,
        text: text
      })
    }
  },
  {
    title: '创建时间',
    width: 180,
    render: (data) => {
      return data.record.createdAt || '--'
    }
  },
  {
    title: '发圈时间',
    width: 180,
    render: (data) => {
      return data.record.sendAt || '--'
    }
  }
]
